package ilender.mappers;

import java.util.List;
import java.util.Set;

import org.apache.ibatis.annotations.*;

import ilender.models.*;

public interface OffersMapper extends BaseMapper<MOffer>{

	/**Returns the offer for the specified request and item ids.*/
	public MOffer findByRequestAndItem(@Param("request_id") long requestId,@Param("item_id") long itemId);

	/**Returns a list of pending offers for the specified Facebook user.*/
	public List<MOffer> fetchPendingAndActiveForUser(long facebookUserId);

	/**Returns a list of items requested by the specified Facebook user.*/
	public Set<Long> idsOfItemsRequestedBy(long facebookUserId);

	/**Returns a list of requests offered to fulfill by the specified Facebook user.*/
	public Set<Long> idsOfRequestsOfferedToBy(long facebookUserId);

	/**Returns a list of offers that should have been returned by now.*/
	public List<MOffer> overDueOffers () ;
}

